package com.java.day07jdbc;

import java.util.List;
import java.util.Scanner;

public class StudentSystem {

    public static void login(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入账号");
        String username = scanner.nextLine();
        System.out.println("输入密码");
        String password = scanner.nextLine();
        //调用工具类
        List<User> list = JDBCUtils.executeQuery(User.class, "select * from t_user where username=? and password=?",
                username, password);
        if(list.size() == 0){
            System.out.println("账号或密码错误");
        }else{
            System.out.println("登录成功");
        }
    }

    public static void main(String[] args) {
        login();
    }
}
